#ifndef _MQTT_H_
#define _MQTT_H_
#include "common_headfile.h"


#define mqtt_pubid "1D5qMXS069"
#define mqtt_devid "infusion"
#define mqtt_token "version=2018-10-31&res=products%2F1D5qMXS069%2Fdevices%2Finfusion&et=1751288198&method=md5&sign=23UFtoFLIITul%2BWaGsKX%2Bg%3D%3D"


#define onenet_post "$sys/" mqtt_pubid "/" mqtt_devid "/thing/property/post"
#define onenet_set "$sys/" mqtt_pubid "/" mqtt_devid "/dp/post/json+"
#define onenet_get "$sys/" mqtt_pubid "/" mqtt_devid "/cmd/request/+"

#define onenet_set_reply "$sys/" mqtt_pubid "/" mqtt_devid "/dp/post/accepted"
#define onenet_get_reply "$sys/" mqtt_pubid "/" mqtt_devid "/cmd/response/+/+"

#define onenet_post_format "{\"id\":%d,\"dp\":%s}"


void clientReconnect();
void send_data(void *pvParameters);
void post_or_get(char* topic, byte* payload, unsigned int length);
void mqtt_init();
#endif